import { defineStore } from 'pinia'
import { ref } from 'vue'
// 用户模块 token settoken removetoken
export const useUserStore = defineStore(
  'big-user',
  () => {
    const token = ref('')
    const id = ref('')

    const setToken = (newToken) => {
      token.value = newToken
    }
    const removeToken = () => {
      token.value = ''
    }
    const setId = (newId) => {
      id.value = newId
    }
    const removeId = () => {
      id.value = ''
    }
    return {
      token,
      setToken,
      removeToken,
      id,
      setId,
      removeId
    }
  },
  {
    persist: true
  }
)